﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NCHQMES
{
    /// <summary>
    /// 螺丝机工作接口
    /// </summary>
    [Serializable]
    public class SCADA_ScrewWorkData
    {
        /// <summary>
        /// 发送数据
        /// </summary>
        [Serializable]
        public class Write : CommonClass.Common_WriteHead
        {
            public Main MAIN = new Main();
        }

        /// <summary>
        /// 接收数据
        /// </summary>
        [Serializable]
        public class Read : CommonClass.Common_ReadHead
        {
            public Main MAIN = new Main();
        }

        /// <summary>
        /// MAIN结构
        /// </summary>
        [Serializable]
        public class Main
        {
            /// <summary>
            /// 事业部
            /// </summary>
            public string BU = "";

            /// <summary>
            /// 部门
            /// </summary>
            public string Dept = "";

            /// <summary>
            /// 线别
            /// </summary>
            public string Line = "";

            /// <summary>
            /// 设备编号
            /// </summary>
            public string EQSN = "";

            /// <summary>
            /// 作业员
            /// </summary>
            public string OperatorName = "";

            /// <summary>
            /// 产品序列
            /// </summary>
            public string SN = "";

            /// <summary>
            /// 站位
            /// </summary>
            public string Station = "";

            /// <summary>
            /// 生产数量
            /// </summary>
            public string Amount = "";

            /// <summary>
            /// 当前批头累计次数
            /// </summary>
            public string BatchTimes = "";

            /// <summary>
            /// 锁钉数量
            /// </summary>
            public string LockScrewQty = "";

            /// <summary>
            /// 不良螺钉数量
            /// </summary>
            public string NgScrewQty = "";

            /// <summary>
            /// 抛钉数量
            /// </summary>
            public string ThrowScrewQty = "";

            /// <summary>
            /// 拍照次数
            /// </summary>
            public string PhotoTimes = "";

            /// <summary>
            /// 吸嘴次数
            /// </summary>
            public string NozzleTimes = "";

            /// <summary>
            /// 气压
            /// </summary>
            public string Pressure = "";

            /// <summary>
            /// 浮高辅助检测功能
            /// </summary>
            public string AssistCheck = "";

            /// <summary>
            /// 整个产品加工周期
            /// </summary>
            public string CtCycle = "";

            /// <summary>
            /// 批头位置(工位)
            /// </summary>
            public string SetHeadPosition = "";

            /// <summary>
            /// 产品过站结果
            /// </summary>
            public string Result = "";

            /// <summary>
            /// 点位参数
            /// </summary>
            public List<PointParameter> PointParameter = new List<PointParameter>();

            /// <summary>
            /// IP
            /// </summary>
            public string IP = "";

            /// <summary>
            /// 设备的主机名
            /// </summary>
            public string HostName = "";

            /// <summary>
            /// 单个产品用时
            /// </summary>
            public float CT = 0;

            /// <summary>
            /// 产品合格数
            /// </summary>
            public int OKQty = 0;
        }

        /// <summary>
        /// MES点位参数结构
        /// </summary>
        [Serializable]
        public class PointParameter
        {
            public string X = "";
            public string Y = "";
            public string Z = "";

            /// <summary>
            /// 扭力
            /// </summary>
            public string Torque = "";

            /// <summary>
            /// 螺丝锁附时长
            /// </summary>
            public string ScrewCT = "";

            /// <summary>
            /// 圈速
            /// </summary>
            public string LockCircleQty = "";

            /// <summary>
            /// 浮高
            /// </summary>
            public string FloatValue = "";

            /// <summary>
            /// 螺丝长度
            /// </summary>
            public string ScrewLength = "";

            /// <summary>
            /// 电批空转转速
            /// </summary>
            public string RacingSpeed = "";

            /// <summary>
            /// 不良代码
            /// </summary>
            public string NgItem = "";

            /// <summary>
            /// 不良描述
            /// </summary>
            public string Desc = "";

            /// <summary>
            /// 扭力上限
            /// </summary>
            public string TorqueUpper = "";

            /// <summary>
            /// 扭力下限
            /// </summary>
            public string TorqueLower = "";

            /// <summary>
            ///圈数上限
            /// </summary>
            public string CircleQtyUpper = "";

            /// <summary>
            /// 圈数下限
            /// </summary>
            public string CircleQtyLower = "";

            /// <summary>
            /// 浮高上限
            /// </summary>
            public string FloatValueUpper = "";

            /// <summary>
            /// 浮高下限
            /// </summary>
            public string FloatValueLower = "";
        }
    }
}